<!-- {% if latest_question_list %}
    <ul>
    {% for question in latest_question_list %}
    <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %} -->



{% if latest_question_list %}
<div style="font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; max-width: 800px; margin: 40px auto; padding: 0 20px;">
    <h1 style="color: #2c3e50; text-align: center; margin-bottom: 30px; font-weight: 600; font-size: 2.2rem; position: relative;">
        <span style="display: inline-block; padding: 0 15px; background: linear-gradient(120deg, #3498db, #2ecc71); -webkit-background-clip: text; -webkit-text-fill-color: transparent; position: relative;">
            最新投票问卷
            <span style="position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #3498db, #2ecc71); border-radius: 3px;"></span>
        </span>
    </h1>

    <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px;">
        {% for question in latest_question_list %}
        <div style="background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative;">
            <div style="position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: linear-gradient(to bottom, #3498db, #2ecc71);"></div>
            <a href="{% url 'polls:detail' question.id %}" style="text-decoration: none; color: inherit; display: block; padding: 25px;">
                <h3 style="color: #2c3e50; margin: 0 0 15px 0; font-weight: 600; font-size: 1.3rem; line-height: 1.4;">{{ question.question_text }}</h3>
                <div style="display: flex; align-items: center; margin-bottom: 15px;">
                    <span style="display: inline-flex; align-items: center; margin-right: 15px; font-size: 0.9rem; color: #7f8c8d;">
                        <svg style="width: 16px; height: 16px; margin-right: 5px; fill: #7f8c8d;" viewBox="0 0 24 24">
                            <path d="M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8 4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z"/>
                        </svg>
                        {{ question.pub_date|date:"Y-m-d" }}
                    </span>
                    <span style="display: inline-flex; align-items: center; font-size: 0.9rem; color: #7f8c8d;">
                        <svg style="width: 16px; height: 16px; margin-right: 5px; fill: #7f8c8d;" viewBox="0 0 24 24">
                            <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.31-8.86c-1.77-.45-2.34-.94-2.34-1.67 0-.84.79-1.43 2.1-1.43 1.38 0 1.9.66 1.94 1.64h1.71c-.05-1.34-.87-2.57-2.49-2.97V5H10.9v1.69c-1.51.32-2.72 1.3-2.72 2.81 0 1.79 1.49 2.69 3.66 3.21 1.95.46 2.34 1.15 2.34 1.87 0 .53-.39 1.39-2.1 1.39-1.6 0-2.23-.72-2.32-1.64H8.04c.1 1.7 1.36 2.66 2.86 2.97V19h2.34v-1.67c1.52-.29 2.72-1.16 2.73-2.77-.01-2.2-1.9-2.96-3.66-3.42z"/>
                        </svg>
                        {{ question.choice_set.count }} 个选项
                    </span>
                </div>
                <div style="display: flex; justify-content: space-between; align-items: center;">
                    <span style="font-size: 0.85rem; color: #bdc3c7; font-weight: 500;">ID: {{ question.id }}</span>
                    <button style="background: linear-gradient(135deg, #3498db, #2ecc71); color: white; border: none; padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; transition: transform 0.2s ease;">
                        立即投票
                        <svg style="width: 16px; height: 16px; margin-left: 5px; fill: white;" viewBox="0 0 24 24">
                            <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
                        </svg>
                    </button>
                </div>
            </a>
        </div>
        {% endfor %}
    </div>
</div>
{% else %}
<div style="font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; max-width: 600px; margin: 100px auto; text-align: center; padding: 40px; background: white; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);">
    <svg style="width: 80px; height: 80px; fill: #bdc3c7; margin-bottom: 20px;" viewBox="0 0 24 24">
        <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/>
        <path d="M11 7h2v2h-2zm0 4h2v6h-2z"/>
    </svg>
    <h2 style="color: #2c3e50; margin: 0 0 10px 0; font-weight: 600;">暂无可用投票</h2>
    <p style="color: #7f8c8d; margin: 0 0 25px 0;">当前没有可用的投票问卷</p>
    <button style="background: linear-gradient(135deg, #3498db, #2ecc71); color: white; border: none; padding: 12px 25px; border-radius: 25px; font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; transition: transform 0.2s ease; box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);">
        <svg style="width: 18px; height: 18px; margin-right: 8px; fill: white;" viewBox="0 0 24 24">
            <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
        </svg>
        创建新问卷
    </button>
</div>
{% endif %}

<!-- 添加到results.html、detail.html和index.html的底部 -->
<footer style="font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: #2c3e50; color: white; padding: 40px 20px; margin-top: 60px;">
    <div style="max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px;">
        <!-- 网站信息 -->
        <div>
            <h3 style="color: #ecf0f1; font-size: 1.5rem; margin-bottom: 20px; position: relative; display: inline-block;">
                <span style="position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #3498db, #2ecc71);"></span>
                投票系统
            </h3>
            <p style="color: #bdc3c7; line-height: 1.6; margin-bottom: 20px;">
                一个简洁高效的在线投票平台，帮助您快速收集用户意见。
            </p>
            <div style="display: flex; gap: 15px;">
                <a href="#" style="color: white; text-decoration: none;">
                    <svg style="width: 24px; height: 24px; fill: currentColor;" viewBox="0 0 24 24">
                        <path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/>
                    </svg>
                </a>
                <a href="#" style="color: white; text-decoration: none;">
                    <svg style="width: 24px; height: 24px; fill: currentColor;" viewBox="0 0 24 24">
                        <path d="M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"/>
                    </svg>
                </a>
                <a href="#" style="color: white; text-decoration: none;">
                    <svg style="width: 24px; height: 24px; fill: currentColor;" viewBox="0 0 24 24">
                        <path d="M12 2.04c-5.5 0-10 4.49-10 10.02 0 5 3.66 9.15 8.44 9.9v-7H7.9v-2.9h2.54V9.85c0-2.51 1.49-3.89 3.78-3.89 1.09 0 2.23.19 2.23.19v2.47h-1.26c-1.24 0-1.63.77-1.63 1.56v1.88h2.78l-.45 2.9h-2.33v7a10 10 0 0 0 8.44-9.9c0-5.53-4.5-10.02-10-10.02z"/>
                    </svg>
                </a>
            </div>
        </div>
 <!-- 快速链接 -->
      <div>
    <h3 style="color: #ecf0f1; font-size: 1.2rem; margin-bottom: 20px;">快速链接</h3>
    <ul style="list-style: none; padding: 0; margin: 0;">
        <li style="margin-bottom: 12px;">
            <a href="{% url 'polls:index' %}" style="color: #bdc3c7; text-decoration: none; transition: color 0.3s; display: flex; align-items: center;">
                <svg style="width: 16px; height: 16px; fill: #3498db; margin-right: 8px;" viewBox="0 0 24 24">
                    <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
                </svg>
                投票首页
            </a>
        </li>
        <li style="margin-bottom: 12px;">
            <a href="/admin/" style="color: #bdc3c7; text-decoration: none; transition: color 0.3s; display: flex; align-items: center;">
                <svg style="width: 16px; height: 16px; fill: #d35400; margin-right: 8px;" viewBox="0 0 24 24">
                    <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/>
                </svg>
                管理员后台
            </a>
        </li>
        <li style="margin-bottom: 12px;">
            <a href="#" style="color: #bdc3c7; text-decoration: none; transition: color 0.3s; display: flex; align-items: center;">
                <svg style="width: 16px; height: 16px; fill: #2ecc71; margin-right: 8px;" viewBox="0 0 24 24">
                    <path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"/>
                </svg>
                常见问题
            </a>
        </li>
        <li style="margin-bottom: 12px;">
            <a href="#" style="color: #bdc3c7; text-decoration: none; transition: color 0.3s; display: flex; align-items: center;">
                <svg style="width: 16px; height: 16px; fill: #e74c3c; margin-right: 8px;" viewBox="0 0 24 24">
                    <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"/>
                </svg>
                隐私政策
            </a>
        </li>
    </ul>
</div>
        <!-- 联系方式 -->
        <div>
            <h3 style="color: #ecf0f1; font-size: 1.2rem; margin-bottom: 20px;">联系我们</h3>
            <ul style="list-style: none; padding: 0; margin: 0;">
                <li style="margin-bottom: 12px; color: #bdc3c7; display: flex; align-items: center;">
                    <svg style="width: 16px; height: 16px; fill: #9b59b6; margin-right: 8px;" viewBox="0 0 24 24">
                        <path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
                    </svg>
                    contact@polls.com
                </li>
                <li style="margin-bottom: 12px; color: #bdc3c7; display: flex; align-items: center;">
                    <svg style="width: 16px; height: 16px; fill: #1abc9c; margin-right: 8px;" viewBox="0 0 24 24">
                        <path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/>
                    </svg>
                    +86 138-XXXX-XXXX
                </li>
                <li style="margin-bottom: 12px; color: #bdc3c7; display: flex; align-items: center;">
                    <svg style="width: 16px; height: 16px; fill: #f39c12; margin-right: 8px;" viewBox="0 0 24 24">
                        <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
                    </svg>
                    海南经贸职业技术学院
                </li>
            </ul>
        </div>
    </div>

    <!-- 版权信息 -->
    <div style="border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 20px; text-align: center; color: #7f8c8d; font-size: 0.9rem;">
        <p style="margin: 0;">© 2025 投票系统. 保留所有权利</p>
    </div>
</footer>